package zwo.service.impl;

import zwo.dao.AdminMapper;
import zwo.model.Admin;
import zwo.model.dto.AdminDTO;
import zwo.service.AdminService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class AdminServiceImpl implements AdminService {
    @Autowired
    private AdminMapper adminMapper;

    public Integer adminAdd(Admin admin) {

        if (adminMapper.adminAddIsName(admin) == 0) {
            return adminMapper.adminAdd(admin);
        } else {
            return 0;
        }
    }

    public Integer adminEditPass(AdminDTO adminDTO) {

        if (adminMapper.adminIsPass(adminDTO) == 0) {
            return 0;
        } else {
            return adminMapper.adminEditPass(adminDTO);
        }
    }
}
